function Coke() {
    //设置cookie
    this.setCookie = (name, value, expdays) => {
        var expdate = new Date();
        //设置Cookie过期日期
        expdate.setDate(expdate.getDate() + expdays);
        //添加Cookie并转码
        document.cookie = encodeURI(name) + "=" + escape(value) + ";expires=" + expdate.toUTCString();

    }

    //得到cookie
    this.getCookie = (name) => {
        //获取name在Cookie中起止位置
        var start = document.cookie.indexOf(name + "=");
        if (start != -1) {
            start = start + name.length + 1;
            //获取value的终止位置
            var end = document.cookie.indexOf(";", start);
            if (end == -1)
                end = document.cookie.length;
            //截获cookie的value值,并返回
            return unescape(document.cookie.substring(start, end));
        }
        return "";
        //console.log( document.cookie)//account=MTMxODk4OTg5ODk%3D; pwd=MTExMTEx
    }

    //删除cookie
    this.delCookie = (name) => {
        this.setCookie(name, "", -1);
    }




}
export default new Coke();